package com.itrus.cryptorole;

import java.security.PrivateKey;
import java.security.cert.X509Certificate;
import java.util.Vector;
import org.bouncycastle.cms.CMSEnvelopedGenerator;
import org.bouncycastle.cms.CMSSignedGenerator;

public abstract class Sender
{
  protected X509Certificate certOfSigner;
  protected String digestOID = CMSSignedGenerator.DIGEST_SHA1;
  protected String encryptAlgorithm = CMSEnvelopedGenerator.DES_EDE3_CBC;
  protected PrivateKey keyOfSigner;
  protected String notAddEncryptCertMessage = "未指定接收者（加密证书），请先调用addRecipientCert方法。";
  protected String notInitializeKeyMessage = "未指定发送者（签名证书或私钥），请先调用initCertWithKey方法。";
  protected String notSupportMessage = "您调用了不支持的方法，" + getClass().getName() + "中尚未重载。";
  protected Vector recipientCerts = new Vector();
  protected String signAlgorithm = "MD5WithRSA";

  public void addRecipientCert(X509Certificate paramX509Certificate)
  {
    this.recipientCerts.add(paramX509Certificate);
  }

  public byte[] doSign(byte[] paramArrayOfByte)
    throws NotSupportException, CryptoException
  {
    throw new NotSupportException(this.notSupportMessage);
  }

  public byte[] encryptMessage(byte[] paramArrayOfByte)
    throws NotSupportException, CryptoException
  {
    if (this.recipientCerts.size() == 0)
      throw new CryptoException("未找到任何加密证书！加密前请先调用addRecipientCert方法。");
    throw new NotSupportException(this.notSupportMessage);
  }

  public byte[] encryptMessageEx(byte[] paramArrayOfByte)
    throws NotSupportException, CryptoException
  {
    throw new NotSupportException(this.notSupportMessage);
  }

  public X509Certificate getSignerCert()
    throws NotSupportException, CryptoException
  {
    if ((this.keyOfSigner == null) || (this.certOfSigner == null))
      throw new CryptoException(this.notInitializeKeyMessage);
    return this.certOfSigner;
  }

  public byte[] getTimeStamp(byte[] paramArrayOfByte, String paramString)
    throws NotSupportException, CryptoException
  {
    throw new NotSupportException(this.notSupportMessage);
  }

  public void initCertWithKey(String paramString1, int paramInt, String paramString2)
    throws NotSupportException, CryptoException, SigningServerException
  {
    throw new NotSupportException(this.notSupportMessage);
  }

  public void initCertWithKey(String paramString1, String paramString2)
    throws NotSupportException, CryptoException
  {
    throw new NotSupportException(this.notSupportMessage);
  }

  public void initCertWithKey(String paramString1, String paramString2, char[] paramArrayOfChar)
    throws NotSupportException, CryptoException
  {
    throw new NotSupportException(this.notSupportMessage);
  }

  public void initCertWithKey(String paramString, char[] paramArrayOfChar)
    throws NotSupportException, CryptoException
  {
    throw new NotSupportException(this.notSupportMessage);
  }

  public void initCertWithKey(String paramString1, char[] paramArrayOfChar1, String paramString2, char[] paramArrayOfChar2)
    throws NotSupportException, CryptoException
  {
    throw new NotSupportException(this.notSupportMessage);
  }

  public void initCertWithKey(PrivateKey paramPrivateKey, X509Certificate paramX509Certificate)
  {
    this.keyOfSigner = paramPrivateKey;
    this.certOfSigner = paramX509Certificate;
  }

  public void setEncryptAlgorithm(String paramString)
  {
    this.encryptAlgorithm = paramString;
  }

  public void setSignAlgorithm(String paramString)
  {
    this.signAlgorithm = paramString;
  }

  public byte[] signMessage(byte[] paramArrayOfByte)
    throws NotSupportException, CryptoException
  {
    throw new NotSupportException(this.notSupportMessage);
  }

  public byte[] signMessageIncludeOriginal(byte[] paramArrayOfByte)
    throws NotSupportException, CryptoException
  {
    throw new NotSupportException(this.notSupportMessage);
  }
}

/* Location:           C:\Users\user\Desktop\dd28_pcdd720\classes_dex2jar.jar
 * Qualified Name:     com.itrus.cryptorole.Sender
 * JD-Core Version:    0.6.2
 */